﻿<UserControl x:Class="DIST.LR.ZHJG.Controls.Chart.ucStackedBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"
    xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
    xmlns:charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
    HorizontalAlignment="Center" VerticalAlignment="Center"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <Style TargetType="charting:VerticalAxisLabels2D">
            <Setter Property="FontFamily" Value="Arial Black"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontSize" Value="14"/>
        </Style>

        <Style x:Key="SeriesLabelStyle" TargetType="telerik:SeriesItemLabel">
            <Setter Property="FontFamily" Value="Arial Black"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Foreground" Value="White"/>
        </Style>

        <charting:SeriesMappingCollection x:Key="VerticalMappings">
            <charting:SeriesMapping CollectionIndex="0">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:StackedBarSeriesDefinition StackGroupName="Stack1" />
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
            <charting:SeriesMapping CollectionIndex="1">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:StackedBarSeriesDefinition StackGroupName="Stack1" />
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
            <charting:SeriesMapping CollectionIndex="2">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:StackedBarSeriesDefinition StackGroupName="Stack1" />
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
            <charting:SeriesMapping CollectionIndex="3">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:StackedBarSeriesDefinition StackGroupName="Stack2" />
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
            <charting:SeriesMapping CollectionIndex="4">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:StackedBarSeriesDefinition StackGroupName="Stack2" />
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
        </charting:SeriesMappingCollection>
        <charting:SeriesMappingCollection x:Key="HorizontalMappings">
            <charting:SeriesMapping LegendLabel="存量建设用地面积" CollectionIndex="0">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:HorizontalStackedBarSeriesDefinition StackGroupName="Stack1" ShowItemLabels="True" />
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue"  />
            </charting:SeriesMapping>
            <charting:SeriesMapping LegendLabel="新增建设用地面积" CollectionIndex="1">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:HorizontalStackedBarSeriesDefinition StackGroupName="Stack1" ShowItemLabels="True"/>
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
            <charting:SeriesMapping LegendLabel="存量面积" CollectionIndex="2">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:HorizontalStackedBarSeriesDefinition StackGroupName="Stack1" ShowItemLabels="True"/>
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
            <charting:SeriesMapping LegendLabel="实际供地面积" CollectionIndex="3">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:HorizontalStackedBarSeriesDefinition StackGroupName="Stack1"  />
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
            <charting:SeriesMapping LegendLabel="带征土地面积" CollectionIndex="4">
                <charting:SeriesMapping.SeriesDefinition>
                    <charting:HorizontalStackedBarSeriesDefinition StackGroupName="Stack1" ShowItemLabels="True"/>
                </charting:SeriesMapping.SeriesDefinition>
                <charting:ItemMapping DataPointMember="YValue" />
            </charting:SeriesMapping>
        </charting:SeriesMappingCollection>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <chart:RadChart x:Name="RadChart1"   
                        BorderBrush="#2975AF" BorderThickness="0" >
            <chart:RadChart.DefaultView>
                <charting:ChartDefaultView ChartLegendPosition="Top" >

                    <charting:ChartDefaultView.ChartLegend>
                        <charting:ChartLegend Name="ChartLegend" LegendItemMarkerShape="Circle" Header="面积类型：" 
                                              HorizontalAlignment="Right" VerticalAlignment="Center" Visibility="Collapsed" />
                    </charting:ChartDefaultView.ChartLegend>

                    <!--<charting:ChartDefaultView.ChartTitle>
                        <charting:ChartTitle Content="杭州市国土资源台账信息展示" Background="#2975AF"/>
                    </charting:ChartDefaultView.ChartTitle>-->

                    <charting:ChartDefaultView.ChartArea>
                        <charting:ChartArea LabelFormatBehavior="None" LegendName="ChartLegend" ItemWidthPercent="50" NoDataString="请查询">
                            <charting:ChartArea.AxisY>
                                <charting:AxisY AutoRange="True" MinValue="0" MaxValue="60" Step="10"
                                                AxisLabelsVisibility="Collapsed" IsInverse="False" LabelRotationAngle="0" 
                                                MajorGridLinesVisibility="Collapsed" MinorGridLinesVisibility="Collapsed"
                                                MajorTicksVisibility="Visible" MinorTicksVisibility="Visible"
                                                StripLinesVisibility="Collapsed"
                                                PlotAreaAxisVisibility="Visible" PlotAreaAxisLabelsVisibility="Visible"

                                                />
                            </charting:ChartArea.AxisY>

                            <charting:ChartArea.AxisX>
                                <charting:AxisX  LayoutMode="Between" LabelStep="1" 
                                                />
                            </charting:ChartArea.AxisX>

                        </charting:ChartArea>
                    </charting:ChartDefaultView.ChartArea>

                </charting:ChartDefaultView>
            </chart:RadChart.DefaultView>
        </chart:RadChart>
    </Grid>
</UserControl>
